<!DOCTYPE html>
<html>
<head>
    <script src="../../scripts/jquery.min.js"></script>
</head>
<body>
<style>
    div { margin:3px; width:40px; height:40px;
        position:absolute; left:0px; top:30px;
        background:green; display:none; }
    div.newcolor { background:blue; }
    span { color:red; }
</style>
<button id="show">Show Length of Queue</button>
<span></span>
<div></div>
<script>
    $("#show").click(function () {
        var n = $("div").queue("fx");
        $("span").text("Queue length is: " + n.length);
    });
    function runIt() {
        $("div").show("slow");
        $("div").animate({left:'+=200'},1000);
        $("div").slideToggle(1000);
        $("div").slideToggle("fast");
        $("div").animate({left:'-=200'},1500);
        $("div").hide("slow");
        $("div").show(1200);
        $("div").slideUp("normal", runIt);
    }
    runIt();
</script>
</body>
</html>